package com.city.repository.pub;

import com.city.domain.supervise.PubKeyPerson;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @deprecation: 重点人员信息
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-18 13:14
 */
@Repository
public interface PubKeyPersonRepository extends JpaRepository<PubKeyPerson,Integer> {

    @Query(value = "select * from pub_key_person where status=?3 limit ?1,?2", nativeQuery = true)
    List<PubKeyPerson> getKeyPersonLimit(Integer limitPage, Integer limitNum ,Integer status);

    @Query(value = "select * from pub_key_person where status=?3 and (name like %?4% or tellphone like %?4%) limit ?1,?2", nativeQuery = true)
    List<PubKeyPerson> getKeyPersonLimit(int i, Integer limitNum, Integer status, String search);

    PubKeyPerson findById(Integer id);

    PubKeyPerson findByName(String name);
}
